const app = getApp();
Page({
	data: {
		url: app.globalData.host,

		list: [],
	},
	onLoad: function (options) {
		wx.setNavigationBarTitle({
			title: "预约"
		})
		this.getList();
	},
	getList(){
		wx.showLoading({title: '加载中…'});
		app.request({
			url: '/app/projectCategory',
			method: 'GET',
			data: {
				parentId: 0
			},
			success: res => {
				this.setData({
					list: res.data
				})
			}
		})
		wx.hideLoading();
	},
	toList(e){
		let id = e.currentTarget.dataset.id;
		let ind = e.currentTarget.dataset.ind;
		let name = this.data.list[ind].categoryName;
		wx.navigateTo({
			url: './list/list?id=' + id + '&name=' + name
		})
	}
})